package zwp.exercise.service.exercisedemo.chapterThree.variablesAndConstants;

/**
 * @Author zwp14
 * @create 2025/10/22 22:25
 * @description 变量和常量的练习
 */
public class Demo {
    public static void main(String[] args) {
        // 比较字符和整数
        exerciseDemoOne();

        // 输出连续的字符
        exerciseDemoTwo();
    }

    /**
     * 在控制台输出“ABCDEFG”
     */
    private static void exerciseDemoTwo() {
        char a = 'A';
        char b = 'B';
        char c = 'C';
        char d = 'D';
        char e = 'E';
        char f = 'F';
        char g = 'G';

        System.out.println(a + "" + "" + b+c+d+e+f+g);
    }

    /**
     * 比较'g'和103是否相等
     */
    private static void exerciseDemoOne() {
        char word = 'g';
        int num = 103;
        if ( word == num){
            System.out.println("'g' 和 103 相等");
        }else {
            System.out.println("'g' 和 103 不相等");
        }
    }
}
